<?php

namespace app\admin\model;

use think\Model;


class SchoolClassSubject extends Model
{


    // 表名
    protected $name = 'school_class_subject';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];
    protected function initialize()
    {
        parent::initialize(); // TODO: Change the autogenerated stub
        //$this->with(['schoolsubject']);
    }

    public function schoolclass()
    {
        return $this->belongsTo('SchoolClass', 'class_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function schoolsubject()
    {
        return $this->belongsTo('SchoolSubject', 'subject_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}
